package com.qiuzhiyi.adapter;

import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.li.widget.DoubleTextView;
import com.qiuzhiyi.R;
import com.qiuzhiyi.item.ZhaoGongItem;

/**
 * Author: Li
 * Date: 2017/11/21 0021
 * Description:
 */

public class ZhaoGongAdapter extends BaseQuickAdapter<ZhaoGongItem.ListBean, BaseViewHolder> {
    private String type;

    public ZhaoGongAdapter(int layoutResId, String type) {
        super(layoutResId);
        this.type = type;
    }

    @Override
    protected void convert(BaseViewHolder helper, ZhaoGongItem.ListBean item) {
        helper.setText(R.id.txt_job_name, item.getCName());
        helper.setText(R.id.txt_job_des, item.getCLuckyDay());
        DoubleTextView doubleTextView = helper.getView(R.id.txt_job_salary);
        helper.setText(R.id.txt_num, "报名");
        switch (type) {
            case "1":
//                helper.setText(R.id.txt_num, "报名");
                doubleTextView.setTxtLeft(item.getCCapital());
                break;
            case "2":
                doubleTextView.setTxtLeft(item.getLsSalary());
//                helper.setText(R.id.txt_num, "小时工");
                break;
        }
        Glide.with(mContext).load(item.getCBirth()).error(R.mipmap.icon).into((ImageView) helper.getView(R.id.img));
    }
}
